<?php

include_once("conn.php");

$id = $_GET['id'];

$sql = "SELECT * FROM `articles` WHERE id=:id";

$stmt = $conn->prepare($sql);
$stmt->bindParam(":id", $id);
$stmt->execute();

// 获取一行内容
$row = $stmt->fetch();

$title = $row['title'];
$content = $row['content'];

?>
<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title><?=$title?> - 台州梁朝伟的博客</title>
</head>
<body>
	<h1><?php echo $title; ?></h1>
	<hr>
	<div><?=$content?></div>
</body>
</html>